package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.domain.Category;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Name CategoryMapper
 * @Author stella
 * @Date 2023-03-02 12:12 PM
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
    //分类列表
    List<Category> findAll();
    //新增分类
    void save(Category c);
    //修改分类
    void update(Category c);
    // 1- 根据分类id查询菜品数量
    Integer countDishByCategoryId(Long id);
    // 2- 根据分类id查询套餐的数量
    Integer countSetmealByCategoryId(Long id);
    // 3- 根据id删除分类
    void delete(Long id);
}
